package com.dianping.cat.consumer.storage.model.entity;

import com.dianping.cat.consumer.storage.model.BaseEntity;
import com.dianping.cat.consumer.storage.model.IVisitor;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;







public class StorageReport
  extends BaseEntity<StorageReport>
{
  private String m_id;
  private String m_name;
  private String m_type;
  private Date m_startTime;
  private Date m_endTime;
  private Set<String> m_ids = new LinkedHashSet();
  
/*  27 */   private Set<String> m_ips = new LinkedHashSet();
  
  private Set<String> m_ops = new LinkedHashSet();
  
  private Map<String, Machine> m_machines = new LinkedHashMap();





/*  37 */   public StorageReport(String id) { this.m_id = id; }




/*  42 */   public void accept(IVisitor visitor) { visitor.visitStorageReport(this); }

  
  public StorageReport addId(String id) {
/*  46 */     this.m_ids.add(id);
/*  47 */     return this;
  }
  
  public StorageReport addIp(String ip) {
/*  51 */     this.m_ips.add(ip);
/*  52 */     return this;
  }
  
  public StorageReport addMachine(Machine machine) {
/*  56 */     this.m_machines.put(machine.getId(), machine);
/*  57 */     return this;
  }
  
  public StorageReport addOp(String op) {
/*  61 */     this.m_ops.add(op);
/*  62 */     return this;
  }

  
  public boolean equals(Object obj) {
/*  67 */     if (obj instanceof StorageReport) {
/*  68 */       StorageReport _o = (StorageReport)obj;

/*  70 */       if (!equals(getId(), _o.getId())) {
/*  71 */         return false;
      }
      
/*  74 */       return true;
    }
    
/*  77 */     return false;
  }

  
/*  81 */   public Machine findMachine(String id) { return (Machine)this.m_machines.get(id); }

  
  public Machine findOrCreateMachine(String id) {
/*  85 */     Machine machine = (Machine)this.m_machines.get(id);

/*  87 */     if (machine == null) {
/*  88 */       synchronized (this.m_machines) {
/*  89 */         machine = (Machine)this.m_machines.get(id);

/*  91 */         if (machine == null) {
/*  92 */           machine = new Machine(id);
/*  93 */           this.m_machines.put(id, machine);
        }
      }
    }
    
/*  98 */     return machine;
  }

  
/* 102 */   public Date getEndTime() { return this.m_endTime; }



/* 106 */   public String getId() { return this.m_id; }



/* 110 */   public Set<String> getIds() { return this.m_ids; }



/* 114 */   public Set<String> getIps() { return this.m_ips; }



/* 118 */   public Map<String, Machine> getMachines() { return this.m_machines; }



/* 122 */   public String getName() { return this.m_name; }



/* 126 */   public Set<String> getOps() { return this.m_ops; }



/* 130 */   public Date getStartTime() { return this.m_startTime; }



/* 134 */   public String getType() { return this.m_type; }



  
  public void mergeAttributes(StorageReport other) {
/* 148 */     assertAttributeEquals(other, "storage-report", "id", this.m_id, other.getId());

/* 150 */     if (other.getName() != null) {
/* 151 */       this.m_name = other.getName();
    }
    
/* 154 */     if (other.getType() != null) {
/* 155 */       this.m_type = other.getType();
    }
    
/* 158 */     if (other.getStartTime() != null) {
/* 159 */       this.m_startTime = other.getStartTime();
    }
    
/* 162 */     if (other.getEndTime() != null) {
/* 163 */       this.m_endTime = other.getEndTime();
    }
  }

  
/* 168 */   public Machine removeMachine(String id) { return (Machine)this.m_machines.remove(id); }

  
  public StorageReport setEndTime(Date endTime) {
/* 172 */     this.m_endTime = endTime;
/* 173 */     return this;
  }
  
  public StorageReport setId(String id) {
/* 177 */     this.m_id = id;
/* 178 */     return this;
  }
  
  public StorageReport setName(String name) {
/* 182 */     this.m_name = name;
/* 183 */     return this;
  }
  
  public StorageReport setStartTime(Date startTime) {
/* 187 */     this.m_startTime = startTime;
/* 188 */     return this;
  }
  
  public StorageReport setType(String type) {
/* 192 */     this.m_type = type;
/* 193 */     return this;
  }
  
  public StorageReport() {}
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/lib/cat-consumer-3.0.0.jar!/com/dianping/cat/consumer/storage/model/entity/StorageReport.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */